<?php
function loaddata()
{
	require_once('./config.php');
	$sql = mysql_query("
		SELECT *
		FROM link
		ORDER BY id DESC
	");
	while($row = mysql_fetch_array($sql))
	{
		echo'
			<tr>
				<td>'.$row['type'].'</td>
				<td class="overload" title="'.$row['link'].'">'.$row['link'].'</td>
				<td class="overload" title="'.$row['category'].'">'.$row['category'].'</td>
				<td class="overload" title="'.$row['project'].'">'.$row['project'].'</td>
				<td class="overload" title="'.$row['cgmtype'].'">'.$row['cgmtype'].'</td>
				<td class="overload">'.$row['addeddate'].'</td>
				<td class="overload" title="'.$row['addedby'].'">'.$row['addedby'].'</td>
				<td class="overload" title="'.$row['status'].'">'.$row['status'].'</td>
				<td class="overload" title="'.$row['statusit'].'">'.$row['statusit'].'</td>
				<td class="overload" title="'.$row['incharge'].'">'.$row['incharge'].'</td>
				<td class="overload" title="'.$row['note'].'">'.$row['note'].'</td>
				<td><input type="checkbox" name="checkbox[]" value="'.$row["id"].'"></td>
			</tr>
		';
	}
}
print_r($_POST['checkbox']);
function deletedata()
{
	if($_POST['checkbox'])
	{
		require_once('./config.php');
		foreach($_POST['checkbox'] as $key => $value) 
		{
			echo $value;
			mysql_query("
				DELETE
				FROM media
				WHERE id = '$value'
			");
		}
	}
}
?>